home *** CD-ROM | disk | FTP | other *** search
- /* movmem.c, from p.159 of Turbo C Bible */
- /* Copies a block of bytes of a buffer to a another
- (handles overlapping source and destination). */
- #include <stdio.h>
- #include <string.h>
- static char src[80]="FirstSecond";
- main()
- {
- printf("Before movmem: Source = %s\n", src);
- movmem(&src[5], src, sizeof(src));
- /* Copy from source to itself */
- printf("After movmem: Source = %s\n", src);
- }